package com.ysy.wiki.controller;

import com.ysy.wiki.domain.Test;
import com.ysy.wiki.service.TestService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class testcontroller {
    @Value("${test.hello:TEST}")
    private String testhello;
    @GetMapping("/hello")
    public String hello(){return "hello world!"+testhello;}
    @PostMapping("/hello/post")
    public String hellopost(String name){return "hello would! post,"+name;}

    @Resource
    private TestService testService;

    @GetMapping("/test/list")
    public List<Test> list(){
        return testService.list();
    }

}


